<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.net.http.HttpCookies</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.net.http.HttpCookies");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791">tango.net.http.HttpCookies</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: April 2004<br><br>
<b>author:</b><br>Kris<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L39">Cookie</a></span>
<script>explorer.outline.addDecl('Cookie');</script> : IWritable;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Defines the Cookie class, and the means for reading &amp; writing them.
        Cookie implementation conforms with RFC 2109, but supports parsing 
        of server-side cookies only. Client-side cookies are supported in
        terms of output, but response parsing is not yet implemented ...</font><br><br>
<font color="black">See over <A HREF="http://www.faqs.org/rfcs/rfc2109.html">here</A>
        for the RFC document.        <br><br></font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L58">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct an empty client-side cookie. You add these
                to an output request using HttpClient.addCookie&#40;&#41;, or
                the equivalent.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L68">this</a></span>
<script>explorer.outline.addDecl('this');</script>(char[] <span class="funcparam">name</span>, char[] <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a cookie with the provided attributes. You add 
                these to an output request using HttpClient.addCookie&#40;&#41;, 
                or the equivalent.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L80">setName</a></span>
<script>explorer.outline.addDecl('setName');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the name of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L92">setValue</a></span>
<script>explorer.outline.addDecl('setValue');</script>(char[] <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the value of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L104">setVersion</a></span>
<script>explorer.outline.addDecl('setVersion');</script>(uint <span class="funcparam">vrsn</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the version of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L116">setPath</a></span>
<script>explorer.outline.addDecl('setPath');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the path of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L128">setDomain</a></span>
<script>explorer.outline.addDecl('setDomain');</script>(char[] <span class="funcparam">domain</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the domain of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L140">setComment</a></span>
<script>explorer.outline.addDecl('setComment');</script>(char[] <span class="funcparam">comment</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the comment associated with this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L152">setMaxAge</a></span>
<script>explorer.outline.addDecl('setMaxAge');</script>(long <span class="funcparam">maxAge</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set the maximum duration of this cookie</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L164">setSecure</a></span>
<script>explorer.outline.addDecl('setSecure');</script>(bool <span class="funcparam">secure</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Indicate whether this cookie should be considered secure or not</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L176">write</a></span>
<script>explorer.outline.addDecl('write');</script>(IWriter <span class="funcparam">writer</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Output the cookie as a text stream, via the provided IWriter</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L187">produce</a></span>
<script>explorer.outline.addDecl('produce');</script>(void delegate(void[]) <span class="funcparam">consume</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Output the cookie as a text stream, via the provided consumer</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L224">clear</a></span>
<script>explorer.outline.addDecl('clear');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Reset this cookie</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L244">CookieStack</a></span>
<script>explorer.outline.addDecl('CookieStack');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Implements a stack of cookies. Each cookie is pushed onto the
        stack by a parser, which takes its input from HttpHeaders. The
        stack can be populated for both client and server side cookies.</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L256">this</a></span>
<script>explorer.outline.addDecl('this');</script>(int <span class="funcparam">size</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a cookie stack with the specified initial extent.
                The stack will grow as necessary over time.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L268">reset</a></span>
<script>explorer.outline.addDecl('reset');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Pop the stack all the way to zero</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Cookie <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L279">push</a></span>
<script>explorer.outline.addDecl('push');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return a fresh cookie from the stack</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L292">resize</a></span>
<script>explorer.outline.addDecl('resize');</script>(inout Cookie[] <span class="funcparam">cookies</span>, int <span class="funcparam">size</span>); [private, static, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Resize the stack such that it has more room.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L306">opApply</a></span>
<script>explorer.outline.addDecl('opApply');</script>(int delegate(inout Cookie) <span class="funcparam">dg</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Iterate over all cookies in stack</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L328">HttpCookiesView</a></span>
<script>explorer.outline.addDecl('HttpCookiesView');</script> : IWritable;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">This is the support point for server-side cookies. It wraps a
        CookieStack together with a set of HttpHeaders, along with the
        appropriate cookie parser. One would do something very similar
        for client side cookie parsing also.</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L341">this</a></span>
<script>explorer.outline.addDecl('this');</script>(HttpHeadersView <span class="funcparam">headers</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct cookie wrapper with the provided headers.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L358">write</a></span>
<script>explorer.outline.addDecl('write');</script>(IWriter <span class="funcparam">writer</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Output each of the cookies parsed to the provided IWriter.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L369">produce</a></span>
<script>explorer.outline.addDecl('produce');</script>(void delegate (void[]) <span class="funcparam">consume</span>, char[] <span class="funcparam">eol</span> = HttpConst.Eol);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Output the token list to the provided consumer</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L381">reset</a></span>
<script>explorer.outline.addDecl('reset');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Reset these cookies for another parse</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>CookieStack <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L394">parse</a></span>
<script>explorer.outline.addDecl('parse');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Parse all cookies from our HttpHeaders, pushing each onto
                the CookieStack as we go.</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L417">HttpCookies</a></span>
<script>explorer.outline.addDecl('HttpCookies');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Handles a set of output cookies by writing them into the list of
        output headers.</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L430">this</a></span>
<script>explorer.outline.addDecl('this');</script>(HttpHeaders <span class="funcparam">headers</span>, HttpHeaderName <span class="funcparam">name</span> = HttpHeader.SetCookie);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct an output cookie wrapper upon the provided 
                output headers. Each cookie added is converted to an
                addition to those headers.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L442">add</a></span>
<script>explorer.outline.addDecl('add');</script>(Cookie <span class="funcparam">cookie</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Add a cookie to our output headers.</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L457">CookieParser</a></span>
<script>explorer.outline.addDecl('CookieParser');</script> : StreamIterator!(char);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Server-side cookie parser. See RFC 2109 for details.</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>static <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L471">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">populate a map of token separators</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L496">this</a></span>
<script>explorer.outline.addDecl('this');</script>(CookieStack <span class="funcparam">stack</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L510">scan</a></span>
<script>explorer.outline.addDecl('scan');</script>(void[] <span class="funcparam">data</span>); [protected]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Callback for iterator.next&#40;&#41;. We scan for name-value
                pairs, populating Cookie instances along the way.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L667">parse</a></span>
<script>explorer.outline.addDecl('parse');</script>(char[] <span class="funcparam">header</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Locate the next token from the provided buffer, and map a
                buffer reference into token. Returns true if a token was 
                located, false otherwise. </font><br><br>
<font color="black">Note that the buffer content is not duplicated. Instead, a
                slice of the buffer is referenced by the token. You can use
                Token.clone&#40;&#41; or Token.toString&#40;&#41;.dup&#40;&#41; to copy content per
                your application needs.<br><br>                Note also that there may still be one token left in a buffer 
                that was not terminated correctly &#40;as in eof conditions&#41;. In 
                such cases, tokens are mapped onto remaining content and the 
                buffer will have no more readable content.<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L679">toLower</a></span>
<script>explorer.outline.addDecl('toLower');</script>(inout char[] <span class="funcparam">src</span>); [static, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">in-place conversion to lowercase </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/net/http/HttpCookies.d?rev=3791#L693">isToken</a></span>
<script>explorer.outline.addDecl('isToken');</script>(char <span class="funcparam">c</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Is 'c' a valid token character?</font><br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2004 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:34 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>